import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import './assets/icons/iconfont/iconfont.css';
import './style.css'
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css'
import VueWechatTitle from 'vue-wechat-title'
import hljs from "highlight.js"
import 'highlight.js/styles/atelier-seaside-light.css'

URLSearchParams.prototype.appendIfExists = function (key, value) {
    if (value !== null && value !== undefined) {
        this.append(key, value)
    }
};

createApp(App)
    .use(router)
    .use(ElementPlus)
    .use(VueWechatTitle)
    .directive('highlight',function (el) {
        let highlight = el.querySelectorAll('pre code');
        highlight.forEach((block)=>{
            hljs.highlightBlock(block)
        })
    })
    .mount('#app');

